<%-- 
    Document   : paginaPrincipal
    Created on : 21/09/2013, 06:09:16 PM
    Author     : Gustavo Coronel
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="css/jquery-ui-1.8.22.custom.css" rel="stylesheet"
	type="text/css">
<link href="css/jquery.datatables.css" rel="stylesheet" type="text/css">
<link href="css/demo_table.css" rel="stylesheet" type="text/css">
<link href="css/demo_table_jui.css" rel="stylesheet" type="text/css">
<link rel="StyleSheet" href="css/estilos.css" type="text/css">
<link rel="StyleSheet" href="menu/menu_style.css" type="text/css">
<title>JSP Page</title>
</head>
<body>
	<div class="divPagina">
		<div class="divCabecera">
			<jsp:include page="cabecera.jsp" />
		</div>
		<div>
			<jsp:include page="menu.jsp" />
		</div>
		<div style="padding: 10px;">

			<h2>MANTENIMIENTO DE ALUMNOS</h2>

			<div id="divFormulario">
				<form id="form1">
					<table>
						<tr>
							<td colspan="2">Apellido</td>
						</tr>
						<tr>
							<td><input type="text" name="apellido" /></td>
							<td><a href="javascript:buscarAlumnos();"><img
									src="img\Search_24x24.png" /></a> <a
								href="javascript:nuevoAlumnos();"><img
									src="img\Add_24x24.png" /></a></td>
						</tr>
					</table>
				</form>
			</div>

			<div id="divWork"></div>

		</div>
		<div>
			<jsp:include page="pie.jsp" />
		</div>
	</div>
	<script type="text/javascript" src="js/jquery-1.8.0.min.js"></script>
	<script type="text/javascript" src="js/jquery-ui-1.8.22.custom.min.js"></script>
	<script type="text/javascript" src="js/jquery.datatables.min.js"></script>
	
	<script type="text/javascript">
		function buscarAlumnos() {
			var data = $("#form1").serialize();
			$("#divWork").html("Procesando, espere.");
			$.post("BuscarAlumnos", data, function(rpta) {
				$("#divWork").html(rpta);
				$("#tblListado").dataTable({				 
				    "bJQueryUI": true,
				    "bFilter": true,
				    "bPaginate": true,
				    "bSort": true,
				    "bLengthChange": false,
				    "iDisplayLength": 5,
				    "aaSorting": []
				});
			});
		}
		function nuevoAlumnos() {
			$.post("NuevoAlumno","",function(rpta){
				$("#divWork").html(rpta);
			});

		}
		function fnEditarAlumno( codigo ){
			var data = "id=" + codigo;
			$.post("EditarAlumno",data,function(rpta){
				$("#divWork").html(rpta);
			});
		}
		
		$("#btnGrabarAlumno").click(function(){
			alert("Falta poco");
		});
		
		function fnGrabarAlumno(){
			var data = $("#formAlumno").serialize();
			alert(data);
		}
	</script>
</body>
</html>
